a125551e3d9c25db1fbcdecd872163a23d03d700,src/main/java/com/algorithmia/algo/Algorithm.java,Algorithm,pipe,#Object#,35
Before Change
*/
public AlgoResponse pipe(Object input) throws APIException {
final Gson gson = new Gson();
final JsonElement inputJson = gson.toJsonTree(input);
final AlgoResponse result = pipeJson(inputJson.toString());
return result;
}
After Change
* @throws APIException if there is a problem communication with the Algorithmia API.
*/
public AlgoResponse pipe(Object input) throws APIException {
if (input instanceof String) {
return pipeRequest((String)input,ContentType.Text);
} else if (input instanceof byte[]) {
return pipeBinaryRequest((byte[])input);
} else {
return pipeRequest(gson.toJsonTree(input).toString(),ContentType.Json);
}
}